package com.ss.android.topic.tips;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.FrameLayout;

public final class a {
    private View a;
    private FrameLayout.LayoutParams b;

    public a(Context arg2, int arg3) {
        this(arg2, arg3, (byte) 0);
    }

    private a(Context arg2, int arg3, byte arg4) {
        this(android.support.design.a.b(new FrameLayout(arg2), arg3));
    }

    private a(View arg4) {
        int v2 = -1;

        this.a = arg4;
        this.a.setTag(this);
        ViewGroup.LayoutParams v0 = arg4.getLayoutParams();
        this.b = (v0 instanceof FrameLayout.LayoutParams) ? ((FrameLayout.LayoutParams)v0) : new FrameLayout.LayoutParams(v2, v2);
    }

    public final View a(View arg4, ViewGroup arg5, int arg6) {
        int v2 = -1;
        View v0 = android.support.design.a.a(arg5, arg6);
        if(v0 != null) {
            v0.bringToFront();
        }
        else {
            this.a.setId(arg6);
            FrameLayout.LayoutParams v0_1 = new FrameLayout.LayoutParams(v2, v2);
            arg4.setVisibility(View.INVISIBLE);
            if(arg5.indexOfChild(arg4) == v2) {
                arg5.addView(arg4, ((ViewGroup.LayoutParams)v0_1));
            }
            else {
                arg4.setLayoutParams(((ViewGroup.LayoutParams)v0_1));
            }

            arg5.addView(this.a, this.b);
            v0 = this.a;
        }

        return v0;
    }
}

